f85048a1b9fc6b2221848f4fbc0a53a3b579a275,framework/base/src/base/org/ofbiz/base/util/GroovyUtil.java,GroovyUtil,runScriptAtLocation,#String#Map#,48
Before Change
parsedScripts.put(location, script);
}
return script.run();
} catch (MalformedURLException e) {
String errMsg = "Error loading Groovy script at [" + location + "]: " + e.toString();
After Change
long startTime = System.currentTimeMillis();
Script script = emptyGroovyShell.parse(scriptString, location);
script.setBinding(getBinding(context));
Object scriptResult = script.run();
if (Debug.timingOn()) Debug.logTiming("Parsed and ran groovy script in [" + (System.currentTimeMillis() - startTime) + "]ms at: " + location, module);
return scriptResult;
} catch (MalformedURLException e) {
String errMsg = "Error loading Groovy script at [" + location + "]: " + e.toString();
throw new GeneralException(errMsg, e);